<?php
class Books_model extends MY_Model{
	var $order_id;
	var $title;
	var $source;
	var $destination;
	var $language;
	var $description;
	var $publisher_id;
	var $picture;
	var $intro;
	var $size;
	var $project_numbers;
	
	function __construct($id=''){
		parent::__construct();
		$GLOBALS['table'] = 'books';
		if($id){
			$query = $this->db->get_where('books',array('id' => $id),1);
			$result = $query->result();
			if(!empty($result)){
				$this->id = $result[0]->id;
				$this->order_id = $result[0]->order_id;
				$this->title = $result[0]->title;
				$this->source = $result[0]->source;
				$this->destination = $result[0]->destination;
				$this->language = $result[0]->language;
				$this->description = $result[0]->description;
				$this->publisher_id = $result[0]->publisher_id;
				$this->picture = $result[0]->picture;
				$this->intro = $result[0]->intro;
				$this->size = $result[0]->size;
				$this->project_numbers = $result[0]->project_numbers;
			}
		}
	}
}